package cn.itlaobing.spring.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.itlaobing.spring.dao.TeacherDao;
import cn.itlaobing.spring.entity.Teacher;
import cn.itlaobing.spring.service.TeachersService;

@Service
public class TeachersServiceimpl implements TeachersService {
	
	@Autowired
	private TeacherDao teacherDao;

	@Override
	public List<Teacher> findAll() {
		List<Teacher> teachers =teacherDao.findAll();
		return teachers;
	}

	@Override
	public void save(Teacher teacher) {
		teacherDao.addTeacher(teacher);
	}

	@Override
	public void delete(Long id) {
		teacherDao.deleteID(id);
	}

	@Override
	public Teacher findAllById(Long id) {
		return teacherDao.findById(id);
	}

	@Override
	public void update(Teacher teacher) {
		teacherDao.update(teacher);
	}

}
